home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / mced-1.1.lha / CEDScripts / Preview.ced < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.6 KB  |  75 lines

  1. /*
  2. **    Preview.ced
  3. **    
  4. **    $VER: Preview.ced 1.1 (10.2.95)
  5. **    
  6. **    This scripts shows current file using MultiView. This way a user can
  7. **    see text's attributes (italic, bold), colors etc. The file is shown on
  8. **    CEd's screen using backdrop window and CEd's font.
  9. **    See docs for more details.
  10. **    
  11. **    This script reuires CygnusEd Professional v3.5 (or later) and Workbench
  12. **    3.0 (or later) to run.
  13. **    
  14. **    Copyright © 1995 Michael Letowski
  15. */
  16.  
  17. /* Get host */
  18. PARSE SOURCE com res called resolved ext host .
  19. IF host="REXX" THEN                                                /* From command line */
  20.     ADDRESS "rexx_ced"                                            /* Talk to default ced */
  21.  
  22. OPTIONS RESULTS                                                        /* Enable results from commands */
  23. ARG windowType .                                                    /* How to show? */
  24.  
  25. 'Status CURSORCOLUMN'                                            /* Get cursor horizontal... */
  26. Column=RESULT+1
  27. 'Status CURSORLINE'                                                /* ... and vertical position */
  28. Line=RESULT+1
  29.  
  30. Comm="SYS:Utilities/MultiView CLIPBOARD"    /* Set up command string */
  31.  
  32. 'Status CLIPUNIT'                                                    /* Get clipboard unit */
  33. ClipUnit=RESULT
  34. IF ClipUnit~="" & ClipUnit~="RESULT" THEN    /* Valid clip unit number */
  35.     Comm=Comm "CLIPUNIT" RESULT                            /* Add to command string */
  36.  
  37. 'Status PUBSCREENNAME'                                        /* Get name of CEd's public screen */
  38. Screen=RESULT
  39. IF Screen~="" & Screen~="RESULT" THEN            /* CygnusEd's screen is public */
  40.     Comm=Comm "PUBSCREEN" Screen                        /* Add to command string */
  41.  
  42. IF Abbrev("BACKDROP",windowType,1) & Screen="CygnusEdScreen1" THEN
  43.     Comm=Comm "BACKDROP"                                        /* Open as a backdrop */
  44.  
  45. 'Status FONTINFO'                                                    /* Get font data */
  46. FontInfo=RESULT
  47. IF FontInfo="Topaz 80 column" THEN                /* Using topaz 8 */
  48.     Comm=Comm "FONTNAME topaz FONTSIZE 8"
  49. ELSE IF FontInfo="Topaz 60 column" THEN        /* Using topaz 9*/
  50.     Comm=Comm "FONTNAME topaz FONTSIZE 9"
  51. ELSE DO                                                                        /* User-selected font */
  52.     PARSE VAR RESULT Name ".font" Size .        /* Parse it */
  53.     IF Name~="" & Name~="RESULT" THEN                /* Valid font name */
  54.         Comm=Comm "FONTNAME" Name                            /* Add name to command string */
  55.     IF Size~="" & Size~="RESULT" THEN                /* Valid font name */
  56.         Comm=Comm "FONTSIZE" Size                            /* Add name to command string */
  57. END
  58.  
  59. 'DM "Copying to clipboard..."'                        /* Let the user know what's going on */
  60.  
  61. 'Beg of file'                                                            /* Copy whole file to clipboard */
  62. 'Mark block'
  63. 'End of file'
  64. 'Copy block'
  65.  
  66. 'LL' Line Column                                                    /* Move cursor to old position */
  67. 'DM "Previewing file..."'                                    /* Change status bar again */
  68.  
  69. ADDRESS COMMAND Comm                                            /* Use MultiView to display contents of Clipboard */
  70.  
  71. 'CEdToFront'                                                            /* Jump back to CEd's screen */
  72. 'DM'                                                                            /* Restore status line */
  73.  
  74. EXIT
  75.